<script setup>
import Aside from './components/Aside.vue';
import Bread from './components/Bread.vue';
import topHeader from './components/topHeader.vue'
import { ref , reactive, watch, computed} from 'vue';
import { useRoute, useRouter } from 'vue-router';
import dashboardStore from '@/store/store.js'
const dashStore = dashboardStore()
const router = useRouter()
const route = useRoute()
const isShow = ref(false)
let arr = ['Dashboard','login']
const menuData= computed(() => {
  return dashStore.menuArr
})
 const isCollapse = ref(true)
 const changeCollapse = () => {
  isCollapse.value = !isCollapse.value
 }
</script>

<template>
  <div>
     <el-container style="height: 100vh;">
      <Aside :menuArr="menuData" v-if="arr.indexOf($route.name) < 0" :isCollapse="isCollapse">
      </Aside>
      <el-container>
        <el-main>
          <topHeader v-if="$route.name !== 'login'" :isOpen="isCollapse" @open="changeCollapse"/>
          <Bread v-if="arr.indexOf($route.name) < 0" />
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
  
</template>

<style scoped>
:deep(.el-sub-menu__title), :deep(.el-menu-item){
  background-color: rgba(0,12,23,1);
  font-family: -regular;
  line-height: 20px;
  color: #FFF;
  font-size: 14px;
  text-align: left;
  font-family: SourceHanSerif-regular;
  border: 0px solid rgba(187,187,187,1);
}
 /* :deep(.el-menu-item:hover){
  background-color: #1990FF;
  line-height: 20px;
  color: rgb(255,255,255);
  font-size: 14px;
  text-align: left;
  font-family: SourceHanSerif-regular;
} */
:deep(.el-main) {
    --el-main-padding: 0;
}
</style>
